package com.dds.web.controller.union;

import com.dds.common.core.controller.BaseController;
import com.dds.common.core.page.TableDataInfo;
import com.dds.system.domain.search.union.UnionProductOrderSearch;
import com.dds.system.domain.search.union.UnionShopOrderSearch;
import com.dds.system.service.union.IUnionProductOrderService;
import com.dds.system.service.union.IUnionShopOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/union/order")
public class UnionShopOrderController extends BaseController {
    @Autowired
    private IUnionShopOrderService unionShopOrderService;

    @Autowired
    private IUnionProductOrderService unionProductOrderService;

    @GetMapping("/shopOrderList")
    @PreAuthorize("@ss.hasPermi('union:shopOrder:list')")
    public TableDataInfo list(UnionShopOrderSearch unionShopOrderSearch) {
        startPage();

        return getDataTable(unionShopOrderService.selectUnionShopOrderList(unionShopOrderSearch));
    }

    @GetMapping("/productOrderList")
    @PreAuthorize("@ss.hasPermi('union:productOrder:list')")
    public TableDataInfo productOrderList(UnionProductOrderSearch unionProductOrderSearch) {
        startPage();

        return getDataTable(unionProductOrderService.selectUnionProductOrderList(unionProductOrderSearch));
    }
}
